<?php

class SurveyModel extends CI_Model{
    
    public function insertSurvey($param) {
        
        $q1 = "";
       
        $data = array(
            'idsp1' => $param['idsp1'],
            'idsp2' => $param['idsp2'],
            'courses' => $param['courses'],
            'name' => $param['name1']. " " .$param['name2'],
            'namekana' => $param['namekana1']. " " .$param['namekana2'],
            'workplace' => $param['workplace'],
            'department' => $param['department'],
            'email' => $param['email'],
            'zip' => $param['zip'],
            'state' => $param['state'],
            'city' => $param['city'],
            'address' => $param['address'],
            'gender' => $param['gender'],
            'phonenumber' => $param['phonenumber'],
            'supplier' => $param['supplier'],
            'idsurvey' => $param['idsurvey'],
            'q1' => $param['q1'],
            'q2' => $param['q2'],
            'q3' => $param['q3'],
            'q4' => $param['q4'],
            'q5' => $param['q5'],
            'q6' => $param['q6'],
            'q7' => $param['q7'],
            'q8' => $param['q8'],
            'q9' => $param['q9'],
            'q10' => $param['q10'] 
        );
     
	$data['created'] = date('Y-m-d h:i:s');
        
        $query = $this->db->insert('survey', $data);
		 
        if($query)
        {
            return TRUE;
        }
        else {
            return FALSE;
        }
    }
	public function viewdata(){
		
	}
}
